1. Technical Field of the Invention
Various embodiments of the present disclosure relate to processors and, more particularly, to a method and system to construct a data-flow analyzer for a bytecode verifier through integrated hardware resources and software.
2. Background Information
Java™ is a programming language that, at the source code level, is similar to object oriented programming languages such as C++. Java™ language source code is compiled into an intermediate representation based on a plurality “bytecodes” that define specific tasks. In some implementations, the bytecodes are further compiled to machine language for a particular processor. In order to speed the execution of Java™ language programs, some processors are specifically designed to execute some of the Java™ bytecodes directly.
Many times, a processor that directly executes Java™ bytecodes is paired with a general purpose processor so as to accelerate Java™ program execution in a general or special purpose machine. After loading a set of Java bytecodes, a verification stage is performed before executing the Java bytecodes. Verification may include data flow analysis. Data flow analysis is a process for collecting type information about data in programs without actually executing them. One aspect of verification is type checking to make sure that parameters each bytecode uses that are passed by other bytecodes are of the expected type, e.g. short, long, Boolean, or integer. Type verification in data flow analysis is performed solely in software in the related art, and various algorithms for type verification exist. Specifically, type verification has been done in the Java Virtual Machine in the related art.
A bytecode data-flow analysis algorithm in the related art is composed of two major processes: 1) decoding the bytecodes in order to browse all of the instructions followed by execution of a process associated with each opcode, and 2) building a stack of type and/or local variable map by tracking write operations issued by the execution of each opcode followed by a check that every value read from the stack or local variable map is of the correct type.
Execution of data flow analysis consumes time, thereby penalizing execution time and application start-up time. Thus, a time and power efficient manner of data flow analysis using hardware resources, rather than a pure software approach, is desirable.